package chapter02;
import java.util.Random;
public class page42 {
    public static void main(String[] args) {

        Random random = new Random(); //声明随机数类对象并实例化
        float x = random.nextFloat(); //产生0.0 到1.0 的随机浮点数
        int month = Math.round(11 * x + 1); //产生1 到12 的随机整数
        switch (month) {
            case 1:
                System.out.println("1月");
                break;
            case 2:
                System.out.println("2月");
                break;
            case 3:
                System.out.println("3月");
                break;

            default:
                System.out.println("错误");
        }

    }
}
